<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script src='../vue.global.js'></script>
    <style>
        .small {
            height: 200px;
            overflow: scroll;
            border: 1px solid black;
        }

        .big {
            height: 2000px;
        }
    </style>
</head>

<body>
    <div id="app">
        <!-- 只有在 `key` 是 `Enter` 时调用 `vm.submit()` -->
        <input @keyup.enter="submit" />
        <input @keyup.page-down="onPageDown" />
        <hr>

        <!-- 系统修饰符 -->
        <!-- Alt + Enter -->
        <input @keyup.alt.enter="clear" />
        <!-- Ctrl + Click -->
        <div @click.ctrl="doSomething">Do something</div>

        <!-- exact -->
        <!-- 即使 Alt 或 Shift 被一同按下时也会触发 -->
        <button @click.ctrl="doSomething">A</button>

        <!-- 有且只有 Ctrl 被按下的时候才触发 -->
        <button @click.ctrl.exact="doSomething">A</button>

        <!-- 没有任何系统修饰符被按下的时候才触发 -->
        <button @click.exact="doSomething">A</button>

        <!-- left/right/middle -->
        <button @click.middle.exact="doSomething">A</button>
    </div>
    
    <script>
        Vue.createApp({
            methods: {
                submit() {
                    console.log("submit");
                },
                onPageDown() {
                    console.log("onPageDown");
                },
                clear() {
                    console.log("clear");
                },
                doSomething() {
                    console.log("doSomething");
                },
            }
        }).mount('#app')
    </script>
</body>

</html>